package com.dmz.workflow.wrapper;

import com.echronos.commons.Result;
import com.echronos.system.feign.IMemberFeign;
import com.echronos.system.req.QueryMemberByIdReq;
import com.echronos.system.req.QueryMemberListReq;
import com.echronos.system.resp.MemberResp;
import com.echronos.system.resp.member.MemberDetailsResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class MemberFeignWrapper {

    @Autowired
    private IMemberFeign memberFeign;

    public List<MemberDetailsResp> queryMemberDetailList(List<Integer> memberIds){
        QueryMemberListReq requestParameter = new QueryMemberListReq();
        requestParameter.setIds(memberIds);
        return memberFeign.queryMemberDetailsList(requestParameter);
    }

    public Result<MemberResp> getMemberById(Integer memberId){
        QueryMemberByIdReq queryMemberByIdReq = new QueryMemberByIdReq();
        queryMemberByIdReq.setId(memberId);
        return memberFeign.getMemberById(queryMemberByIdReq);
    }
}
